import { S } from '../s';
import { IPSAppLan } from './ipsapp-lan';
import { IPSLanguageItem } from '../res/ipslanguage-item';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSAppLanImpl extends PSModelObjectImpl implements IPSAppLan {
  protected allpslanguageitems: IPSLanguageItem[];
  getAllPSLanguageItems(): IPSLanguageItem[] | null {
    return (
      this.allpslanguageitems ||
      (this.allpslanguageitems = this.fillChildListModel(
        this.M.getAllPSLanguageItems,
        S._3d4,
      ) as IPSLanguageItem[])
    );
  }

  findPSLanguageItem(objKey: any): IPSLanguageItem | null {
    return this.getPSModel5(
      S._3d4,
      this.getAllPSLanguageItems(),
      objKey,
    ) as IPSLanguageItem;
  }

  get language(): string {
    return this.M.language;
  }
  get cls(): string {
    return 'PSAppLanImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._12) return true;
    return super.instanceof(cls);
  }
}
